package com.solution.admin.product.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.solution.admin.product.dao.ProductRecommendDao;
import com.solution.admin.product.entity.ProductRecommendEntity;
import com.solution.common.dao.impl.BaseDaoImpl;

/**
 * 商品推荐DAO实现
 * 
 * @author xu_cc
 * @date 2017-08-31 23:39:07
 */
@Repository
public class ProductRecommendDaoImpl extends BaseDaoImpl<ProductRecommendEntity> implements ProductRecommendDao {

    /**
     * 保存商品推荐信息
     * 
     * @param ebProductRecommendEntity
     * @return
     * @author xu_cc
     * @date 2017-08-31 23:39:07
     */
    @Override
    public long saveProductRecommend(ProductRecommendEntity ebProductRecommendEntity) {
        return super.insert(ebProductRecommendEntity);
    }

    /**
     * 删除商品推荐
     * 
     * @param ebProductRecommendId
     * @return
     * @author xu_cc
     * @date 2017-08-31 23:39:07
     */
    public int deleteByProductId(Long productId) {
        return super.getSessionTemplate().delete(getStatement("deleteByProductId"), productId);
    }

    /**
     * 根据条件查询商品推荐
     * 
     * @param param
     * @return
     * @author xu_cc
     * @date 2017-08-31 23:39:07
     */
    @Override
    public List<ProductRecommendEntity> listProductRecommend(Map<String, Object> param) {
        return super.listBy(param);
    }
}
